package cn.edu.xhu.library_management.user.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

/**
 * 校外用户
 * @TableName lm_user_ohter
 */
@TableName(value ="lm_user_ohter")
@Data
public class LmUserOhter implements Serializable {
    /**
     * 11位
     */
    @TableId(value = "oth_account")
    private String othAccount;

    /**
     * 用户密码(加密)
     */
    @TableField(value = "oth_pwd")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String othPwd;

    /**
     * 用户真实姓名
     */
    @TableField(value = "oth_name")
    private String othName;

    /**
     * 用户昵称
     */
    @TableField(value = "oth_nickName")
    private String othNickname;

    /**
     * 用户照片
     */
    @TableField(value = "oth_img")
    private String othImg;

    /**
     * 用户性别
     */
    @TableField(value = "oth_gender")
    private String othGender;

    /**
     * 用户电话
     */
    @TableField(value = "oth_phone")
    private String othPhone;

    /**
     * 用户邮箱
     */
    @TableField(value = "oth_email")
    private String othEmail;

    /**
     * 用户余额
     */
    @TableField(value = "oth_balance")
    private Double othBalance;

    /**
     * 用户可借数量
     */
    @TableField(value = "oth_borrow_num")
    private Integer othBorrowNum;

    /**
     * 用户是否锁定(0 锁定 1 未锁定)
     */
    @TableField(value = "oth_isLock")
    private Integer othIslock;

    /**
     * 创建时间
     */
    @TableField(value = "oth_creat_time",fill = FieldFill.INSERT)
    private Date creatTime;

    /**
     * 更新时间
     */
    @TableField(value = "oth_up_time",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public void doDefault(){
        this.setOthNickname("小丑");
        this.setOthBalance(0.0);
        this.setOthPhone(this.getOthAccount());
        this.setOthImg("/smart-library/server/book/a63f86fd-8d2d-4e5d-97ea-fa735d1544be-s33716278.jpg");
        this.setOthIslock(1);
        this.setOthBorrowNum(3);
    }
}